package com.lt.lumentracks.service;

import com.lt.lumentracks.entity.po.Comment;
import com.baomidou.mybatisplus.extension.service.IService;
import com.lt.lumentracks.entity.vo.comment.CommentVO_ReplyToMe;
import com.lt.lumentracks.entity.vo.comment.CommentVO_liked;
import com.lt.lumentracks.entity.vo.comment.CommentVO_post;
import com.lt.lumentracks.entity.vo.common.PageVO;
import com.lt.lumentracks.entity.vo.common.Result;

import java.util.List;
import java.util.Set;

/**
 * <p>
 * 评论表 服务类
 * </p>
 *
 * @author swl
 * @since 2025-08-18
 */
public interface ICommentService extends IService<Comment> {

    // 新增评论
    Result addComment(Comment comment);

    // 删除评论
    void removeCommentById(Integer id);

    // 更新回复数
    void updateRepliesCount(Comment comment, Boolean addOrMinus);

    // 更新回复数(根据id更新)
    void updateRepliesCountById(Long id, Boolean addOrMinus);

    // 根据文章id获取评论
    PageVO<CommentVO_post> getByPostId(Integer postId, String sortRule, long current, long size);

    // 获取回复
    List<CommentVO_post> getReplies(Integer postId, Long cid, long current, long size);

    // 查询回复了我的评论
    Result<PageVO<CommentVO_ReplyToMe>> getForMyRelies(long current, long size);


    // 添加点赞记录
    void addLikeRecord(Long cid, Integer userId_liked, Boolean addOrDel);

    // 查询某些评论的点赞状态
    Result<Set<Long>> isLiked(List<Long> cIds);

    // 批量更新点赞数
    void updateLikedNumber(int batchSize);
    
    // 查询用户最近被点赞的评论
    Result<PageVO<CommentVO_liked>> getMyRecentLikedComments(long current, long size);
}
